﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using resharperupdate.core.controllers;
using resharperupdate.core.controllers.impl;

namespace resharperupdate.cons
{
    class Program
    {
        private readonly IUpdaterController controller;

        public Program() : this(new UpdaterController())
        {
        }

        public Program(IUpdaterController controller)
        {
            this.controller = controller;
            this.controller.display = console_output;
            this.controller.status = status_change;
        }

        private void console_output(string title, string description)
        {
            Console.WriteLine(title + " - " +description);
        }

        private void status_change (InstallStatus status){}

        static void Main(string[] args)
        {
            new Program().start();
        }

        private void start()
        {
            Console.WriteLine("Resharper Updater v" + Assembly.GetExecutingAssembly().GetName().Version);
            controller.install_latest();
        }
    }
}
